package oj;

import java.util.Random;

public class LC384 {
    int[] nums;
    int n;
    Random random=new Random();
    public LC384(int[] nums) {
        this.nums=nums;
        this.n=nums.length;
    }

    public int[] reset() {
        return nums;
    }

    public int[] shuffle() {
        int[] arr=nums.clone();
        for(int i=0;i<n;i++){
            swap(arr,i,i+random.nextInt(n-i));
        }
        return arr;
    }
    private void swap(int[] arr,int i,int j){
        int tmp=arr[i];
        arr[i]=arr[j];
        arr[j]=tmp;
    }
}
